﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;
using System.Data.SqlClient;

public partial class Users_Home : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        MembershipUser user = Membership.GetUser();
        lblWelcome.Text = "Welcome, " + user.UserName;
        ProfileCommon p = Profile.GetProfile(user.UserName);
        if (p.SkyMeter < 0)
        {
            p.SkyMeter = 0;
            p.Save();
        }
        lblSkyMeter.Text = p.SkyMeter.ToString() + " km";
    }

    protected void SqlDataSource1_Init(object sender, EventArgs e)
    {
        SqlDataSource1.SelectParameters["UserID"].DefaultValue = Membership.GetUser().ProviderUserKey.ToString();
    }
}
